import logging

from scan.models import Machine
from sdk.ali.ecs import AliEcs


def get_all_ecs():
    """重新采集所有通过sdk获取的主机信息"""
    logging.info('start get_ecs_all')
    Machine.objects.filter(CreateMethod=2).delete()
    ali = AliEcs()
    ali.get_ecs()
    logging.info('end get_ecs_all')
